package com.changwu.cwbase.AppTest.Algorithms;


/**
 * Created by Administrator on 2018/10/14.
 */

public class Recursive {
    public void testRecursiveAlgorithms() {
        fun1(1);
    }

    public static void fun1(int n) {
        System.out.printf("1111111111111-lexe:%d \n", n);   //#1
        if (n < 2)
            fun1(n + 1);
        System.out.printf("2222222222222-lexe:%d \n", n);   //#2
    }

    public static void testRecursive2() {
        fun2(1);
    }

    public static void fun2(int n) {
        System.out.printf("1111111111111-lexe:%d \n", n);   //#1
        if (n < 2)
            fun2(n + 1);
        System.out.printf("2222222222222-lexe:%d \n", n);   //#2
        if (n < 2)
            fun2(n + 1);
        System.out.printf("3333333333333-lexe:%d \n", n);   //#3
    }
}
